#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START kmod
# depends: xz
# depends: zlib

reset_mtime kmod kmod/configure.ac
mkdir -p build/kmod
cd build/kmod
env PATH=$stage/$build_prefix/bin:$PATH \
../../kmod/configure \
	${CONFIGURE_ARGS} \
	--with-xz \
	--with-zlib \
	${AUTOCRAP_KLUDGE}

cd ../..
make_build build/kmod
mkdir -p -m755 "${stage}${prefix}/sbin"
for tool in depmod insmod lsmod modinfo modprobe rmmod; do
	ln -sf ../bin/kmod "${stage}$prefix/sbin/$tool"
done

# RECIPE END kmod
